package com.hkd.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum ResultCode {
    // 操作成功
    SUCCESS(1000, "操作成功"),

    // 服务器内部错误，友好提示
    ERROR(2000, "服务繁忙请稍后重试"),

    // 操作失败，但是服务器不存在异常
    FAILED(3000, "操作失败"),
    FAILED_UNAUTHORIZED(3001, "未授权"),
    FAILED_PARAMS_VALIDATE(3002, "参数校验失败"),
    FAILED_NOT_EXISTS(3003, "资源不存在"),
    FAILED_DATA_NOT_EXIST(3014, "查询问题链表为空"),
    FAILED_ALREADY_EXISTS(3004, "资源已存在"),

    FAILED_TOKEN_PARSE(3005, "token解析失败"),
    FAILED_TOKEN_NULL(3008, "token为空"),
    FAILED_TOKEN_EXPIRED(3006, "token已过期"),
    FAILED_TOKEN_INVALID(3007, "token无效"),
    FAILED_TOKEN_GET_INFO(3012, "token获取用户信息失败"),
    FAILED_SYSUSER_ADD(3009, "系统用户添加失败"),
    FAILED_SYSUSER_UPDATE(3010, "系统用户更新失败"),
    FAILED_SYSUSER_DELETE(3011, "系统用户删除失败"),
    FAILED_DELETE(3013, "删除失败"),

    FAILED_QUESTION_ADD(3015, "题目添加失败"),
    FAILED_QUESTION_HAS_EXITS(3016, "题目已存在"),
    FAILED_QUESTION_AddDTO(3017, "DTO参数为空校验失败"),
    FAILED_QUESTION_EXIT(3018, "题目编辑查询失败"),
    FAILED_QUESTION_EXIT_UPDATE(3019, "题目编辑更新失败"),
    FAILED_QUESTION_DELETE(3020, "题目删除失败"),

    FAILED_EXAM_ADD(3030, "竞赛添加失败"),
    FAILED_EXAM_ADD_TIME(3031, "竞赛添加时间异常"),
    FAILED_EXAM_AddDTO(3032, "参数不能为空"),
    FAILED_EXAM_QUESTION(3033, "题目为空"),
    FAILED_EXAM_QUESTION_NOT_EXISTS(3034, "题目不存在"),
    FAILED_EXAM_NOT_EXISTS(3035, "竞赛不存在"),
    FAILED_EXAM_EDIT(3035, "竞赛不存在"),
    FAILED_EXAM_HAS_START(3036, "竞赛已开始"),
    FAILED_EXAM_DELETE(3037, "竞赛题目删除失败"),
    FAILED_EXAM_PUBLISH(3038, "发布失败"),
    FAILED_EXAM_USER_STATE(3039, "用户状态更新失败"),
    FAILED_EXAM_USER_HAS_ENTER(3040, "不能重复报名"),
    FAILED_EXAM_USER_ENTER(3041, "报名添加失败"),

    FAILED_USER_PHONE(3044, "手机号不合法"),
    FAILED_SMS_FREQUENCY(3045, "短信发送频率过高，请稍后再试"),
    FAILED_SMS_TIME_LIMIT(3047, "短信发送超出限制"),
    FAILED_SEND_SMS(3046, "短信发送失败"),
    FAILED_CODE_EXPIRED(3048, "验证码已过期"),
    FAILED_CODE_ERROR(3049, "验证码错误"),

    FAILED_REGISTER_USER(3050, "注册用户失败"),

    FAILED_FIRST_QUESTION               (3501, "当前题目已经是第一题了哦"),

    FAILED_LAST_QUESTION                (3502, "当前题目已经是最后一题了哦"),


    // 用户已存在
    USER_EXISTS(3101, "用户已存在"),
    // 用户不存在
    USER_NOT_EXISTS(3102, "用户不存在"),
    // 用户名或密码错误
    LOGIN_FAILED(3103, "用户名或密码错误"),
    // 用户已被列入黑名单，请联系管理员
    USER_BANNED(3104, "您已被列入黑名单, 请联系管理员.");

    private int code;

    private String message;

    @Override
    public String toString() {
        return "code = "+ code +",message ="+message;
    }

}
